{% extends "WebMainSiteBundle:User:layout.html.twig" %}
{% set title = "课程基本信息" %}
{% block title %}
    {{ title }}
{% endblock %}

{% block myJs %}
    {% include "AssetsUploadBundle:Uploadify:webPic.one.html.twig" %}
    <script>
        function rm(a){
            a.remove();
        }
    </script>
{% endblock %}
{% block user_main %}
    {% if course.id is defined %}
        <input type="hidden" name="id" value="{{ app.request.get("id") }}" />
    {% endif %}
    <form class="form-horizontal" method="post" enctype="multipart/form-data">
        <div class="row">
            <div class="col-md-8">
                <div class="form-group">
                    <div class="col-md-3 text-right"><label class="control-label" for="title">课程标题:</label></div>
                    <div class="col-md-8">
                        <input
                                name="title"
                                id="title"
                                type="text"
                                class="form-control input-lg"
                                placeholder="请设置课程标题"
                                value="{% if course.title is defined %}{{ course.title }}{% endif %}"
                                />
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-md-3 text-right"><label class="control-label" for="category">课程分类:</label></div>
                    <div class="col-md-8">
                        <select name="category"  class="form-control input-lg">
                            {% for c in courseCategory %}<option value="{{ c.id }}">{{ c.name }}</option>{% endfor %}
                        </select>
                    </div>
                </div>
                {#<div class="form-group">#}
                    {#<div class="col-md-3 text-right"><label class="control-label" for="picCover">封面图片:</label></div>#}
                    {#<div class="col-md-8">#}
                        {#{% include "AssetsUploadBundle:Uploadify:webPic.one.mod.html.twig" with {pic:course["picCover"],name:"picCover"}%}#}
                    {#</div>#}
                {#</div>#}
                {#<div class="form-group">#}
                    {#<div class="col-md-3 text-right"><label class="control-label" for="picMain">课程主图:</label></div>#}
                    {#<div class="col-md-8">#}
                            {#<div style="width: 160px;height: 160px;display: inline-block;overflow: hidden; position: relative">#}
                                {#&#123;&#35;<a style="position: absolute; z-index: 9999;top:0;left: 0;" href="javascript:rm($(this));">{% if course["picMain"] is defined %}<img src="{{ course["picMain"] }}" width="160" height="160" />{% endif %}</a>&#35;&#125;#}
                                {#<input id="picMain" class="uploadify_upload" type="file"/>#}
                            {#</div>#}
                    {#</div>#}
                {#</div>#}
                <div class="form-group">
                    <div class="col-md-3 text-right"><label class="control-label" for="info">课程简介:</label></div>
                    <div class="col-md-8">
                        <textarea  name="info" class="form-control" rows="11" id="info" placeholder="课程简介">{% if course.info is defined %}{{ course.info }}{% endif %}</textarea>
                    </div>
                </div>
                <p class="buttons-margin-horizontal">
                    <input type="submit" class="btn btn-theme btn-green" value="提交" />
                </p>
            </div>
        </div>
        {#课程主图：#}
            {#<a href="javascript:rm($(this));">{% if course["picMain"] is defined %}<img src="{{ course["picMain"] }}" width="160" height="160" />{% endif %}</a>#}
        {#<div style="width: 160px;height: 160px;display: inline-block;overflow: hidden;"><input id="picMain" class="uploadify_upload" type="file"/></div>#}
        {#<input type="submit" />#}
    </form>
{% endblock %}